<?php
header('Content-Type: text/html; charset=UTF-8');
require 'database.php';
$db = new DB();

// Select games ID
$Qry = 'SELECT name, url
		FROM catgories
		WHERE has_child = 0 AND parent != 0
		ORDER BY name ASC';
$res = $db->fetchAll($Qry);

echo '<ul>';
foreach ($res as $key=>$value) {
	echo '<li>' . ($key+1) . ' - <a href="/_crawl/index.php?c=' . $value['url'] . '" target="_blank">' . $value['name'] . '</a></li>';
// 	echo '<li>' . ($key+1) . ' - <a href="/_crawl/index.php?c=' . $value['url'] . '&p=11" target="_blank">' . $value['name'] . '</a></li>';
}
echo '</ul>';

// echo $_SERVER['DOCUMENT_ROOT'];
// exit();